﻿
//Author: 张亚涛
//createtime:2011-10-13 10:41:57
//Description: 

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using DAL;

namespace BLL
{

    /// <summary>
    /// 该类提供了一系列操作 "Communty" 表的方法;
    /// </summary>
    public class CommuntyService
    {
        #region .对本表的维护.
        #region select data
        /// <summary>
        /// 返回CarType表的所有数据
        /// </summary>
        /// <param name="CommuntyName">小区名称</param>
        /// <returns></returns>        
        public static List<Communty> GetAllCommunty(string CommuntyName)
        {
            return CommuntyBase.GetAllCommunty(CommuntyName);
        }
        /// <summary>
        /// 根据Communty表的CommuntyID字段返回数据  
        /// </summary>
        /// <param name="CommuntyID">CommuntyID</param>
        /// <returns></returns>        
        public static Communty GetCommuntyByCommuntyID(int CommuntyID)
        {
            return CommuntyBase.GetCommuntyByCommuntyID(CommuntyID);
        }
        /// <summary>
        /// 根据小区ID返回小区名称 
        /// </summary>
        /// <param name="CommuntyID">车型ID</param>
        /// <returns></returns>       
        public static string GetCommuntyNameByID(int CommuntyID)
        {
            return CommuntyBase.GetCommuntyNameByID(CommuntyID);
        }
         /// <summary>
        /// 返回员工负责小区名字  
        /// </summary>
        /// <param name="WeChat">员工微信号</param>
        /// <returns></returns>        
        public static string GetComNameStr(string WeChat)
        {
            return CommuntyBase.GetComNameStr(WeChat);
        }
        #endregion
        #region delete data
        /// <summary>
        /// 根据Communty表的AreaID字段删除数据 
        /// </summary>
        /// <param name="CommuntyID">CommuntyID</param>
        /// <returns>返回受影响的行数</returns>
        public static int DeleteCommuntyByCommuntyID(int CommuntyID)
        {
            if (CommuntyBase.DeleteCommuntyByCommuntyID(CommuntyID) > 0)
            {
                return CommuntyBase.DeleteCommuntyByCommuntyID(CommuntyID);
            }
            else
            {
                return 0;
            }
        }
        #endregion
        #region update data
        /// <summary>
        /// 根据Communty表的CommuntyID字段更新数据 
        /// </summary>
        /// <param name="CommuntyID">CommuntyID</param>
        /// <param name="Communty">Communty</param>
        /// <returns>返回受影响的行数</returns>
        public static int UpdateCommuntyByCommuntyID(Communty CommuntyID)
        {
            return CommuntyBase.UpdateCommuntyByCommuntyID(CommuntyID);
        }
        #endregion
        #region insert data
        /// <summary>
        /// 向CarType表插入一条数据，插入成功则返回自增列数值，插入不成功则返回-1 
        /// </summary>
        /// <param name="Communty">Communty</param>        
        /// <returns></returns>
        public static int AddCommunty(Communty Communty)
        {
            return CommuntyBase.AddCommunty(Communty);
        }
        #endregion
        #endregion

        #region .SQL语句汇总.
        /// <summary>
        /// 返回CarType表的所有数据 （SQL语句）
        /// <param name="CommuntyName">小区名称</param>
        /// </summary>
        /// <returns></returns>        
        public static string GetAllCommunty_SQL(string CommuntyName)
        {
            return CommuntyBase.GetAllCommunty_SQL(CommuntyName);
        }
        #endregion
    }
}